package com.gykfbxxh.imovie.view.filmsdetail.view;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RatingBar;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.ViewFlipper;

import com.app.utils.util.ToastUtils;
import com.app.utils.util.ViewSizeUtils;
import com.gykfbxxh.imovie.R;
import com.gykfbxxh.imovie.adapter.FilmsAboutAdapter;
import com.gykfbxxh.imovie.base.BaseActivity;
import com.gykfbxxh.imovie.bean.film.FilmDetailInfo;
import com.gykfbxxh.imovie.bean.film.FilmEntity;
import com.gykfbxxh.imovie.bean.film.FilmSourceBean;
import com.gykfbxxh.imovie.bean.film.FilmVideoLocal;
import com.gykfbxxh.imovie.config.ConfigKey;
import com.gykfbxxh.imovie.custom.video.XxhVideoPlayerController;
import com.gykfbxxh.imovie.greendao.GDManager;
import com.gykfbxxh.imovie.manager.AppConfigManager;
import com.gykfbxxh.imovie.utils.ViewFlipperUtils;
import com.gykfbxxh.imovie.utils.glide.ImageLoader;
import com.gykfbxxh.imovie.videoplayer.JCUserActionStandard;
import com.gykfbxxh.imovie.view.filmsdetail.acitivity.FilmDetailActivity;
import com.xiao.nicevideoplayer.NiceVideoPlayer;

import java.util.ArrayList;
import java.util.List;

/**
 * 内容详情自定义View
 * Created by xuxinghai on 2016/11/3.
 */
public class DetailFilmView extends ScrollView implements View.OnClickListener,JCUserActionStandard {


    private ScrollCallback scrollCallback;//操作监听
    private Context context;
    public String httpName;//数据请求的标识

    public DetailFilmView(Context context) {
        super(context);
        this.context = context;
    }

    public DetailFilmView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context = context;
    }


    private LinearLayout ll_back_gg,ll_share,ll_video_ll,ll_headbg_view,ll_openvideoview,ll_filmsub_more,ll_aboutlist;
    private ImageView iv_photoleft,iv_head_bgview;
//    private JCVideoPlayerStandard item_videoplayer;
    private NiceVideoPlayer nice_video_player;
    private TextView tv_title,tv_starsum,tv_release_country,tv_type,tv_sourcesum,tv_filmsub;
    private RatingBar ratingBar;
    private View view_labels_line,view_aboutlist;
//    private LabelsView labels;
    private ExpandListview lv_aboutlist;
    private LinearLayout ll_imglistview ,ll_ll_imglistview,ll_headbottom;
    private RelativeLayout rl_autoview;
    private ViewFlipper viewflipper;
    boolean isbeginStyle ;
    private ImageView iv_save,iv_opensub;
    /**
     * 初始化控件
     */
    public void init(OnClickListener onClickListener) {
        isbeginStyle = AppConfigManager.getInstance().getConfigSP().getBoolean(ConfigKey.beginsStyle, false);
        inflate(getContext(), R.layout.view_detailfilm, this);
        iv_head_bgview = (ImageView)findViewById(R.id.iv_head_bgview);//顶部背景布局
        ll_back_gg = (LinearLayout)findViewById(R.id.ll_back_gg);//返回按钮
        ll_share = (LinearLayout)findViewById(R.id.ll_share);//分享按钮
        iv_photoleft = (ImageView)findViewById(R.id.iv_photoleft);//左侧海报
        ll_video_ll = (LinearLayout)findViewById(R.id.ll_video_ll);//多视频外控件
        nice_video_player = (NiceVideoPlayer)findViewById(R.id.nice_video_player);
        nice_video_player.setPlayerType(NiceVideoPlayer.TYPE_IJK);
//        item_videoplayer = (JCVideoPlayerStandard)findViewById(item_videoplayer);//视频播放控件
//        item_videoplayer.setJcUserAction(this);
        tv_title = (TextView)findViewById(R.id.tv_title);//电影标题
        ratingBar = (RatingBar)findViewById(R.id.ratingBar);//星星评分控件
        tv_starsum = (TextView)findViewById(R.id.tv_starsum);//评分数
        tv_release_country = (TextView)findViewById(R.id.tv_release_country);//上映时间及国家
        tv_type = (TextView)findViewById(R.id.tv_type);//电影类型
        tv_sourcesum = (TextView)findViewById(R.id.tv_sourcesum);//源地址数
        ll_openvideoview = (LinearLayout)findViewById(R.id.ll_openvideoview);//播放视频源
        tv_filmsub = (TextView)findViewById(R.id.tv_filmsub);//电影简介
        ll_filmsub_more = (LinearLayout)findViewById(R.id.ll_filmsub_more);//展示全部简介
        iv_opensub = (ImageView)findViewById(R.id.iv_opensub);
        iv_opensub.setImageResource(R.drawable.down);
        viewflipper = (ViewFlipper)findViewById(R.id.viewflipper);
        ll_headbottom = (LinearLayout)findViewById(R.id.ll_headbottom);
        iv_save = (ImageView)findViewById(R.id.iv_save);
        iv_save.setImageResource(R.drawable.like_1);
//        labels = (LabelsView)findViewById(labels);//标签控件
//        labels.setSelectType(LabelsView.SelectType.NONE);
        rl_autoview = (RelativeLayout)findViewById(R.id.rl_autoview);

        view_labels_line = findViewById(R.id.view_labels_line);

        ll_aboutlist = (LinearLayout)findViewById(R.id.ll_aboutlist);
        lv_aboutlist = (ExpandListview)findViewById(R.id.lv_aboutlist);//相关推荐电影 暂时隐藏
        view_aboutlist = findViewById(R.id.view_aboutlist);

        ll_imglistview = (LinearLayout)findViewById(R.id.ll_imglistview);//热门电影推荐
        ll_ll_imglistview = (LinearLayout)findViewById(R.id.ll_ll_imglistview);//热门电影推荐

//        ll_back_gg.setOnClickListener(onClickListener);
//        ll_share.setOnClickListener(onClickListener);
        ll_filmsub_more.setOnClickListener(this);
        ll_openvideoview.setOnClickListener(this);

        getLikeLookData();//获取用户想看信息
    }

    List<String> likeData = null ;//用户收藏本地数据库列表
    private void getLikeLookData() {
        likeData = GDManager.getInstance().getLikeLookListData();
        if(likeData==null) {
            likeData = new ArrayList<>();
        }
    }

    String videoUrl = "";
    String imgurl = "";
    String videoName = "";
    /**
     * 加载电影内容
     */
    public void setFilmData(FilmDetailInfo.ResultBean filmInfoBean, List<FilmEntity> guesslist, FilmVideoLocal.FilmVideoBean filmVideoBean, List<FilmSourceBean.FilmSource> filmSourceList, DetailScrollView mScrollView) {
        if(filmInfoBean!=null) {
            FilmDetailInfo.ResultBean.FilminfoBean filminfo = filmInfoBean.getFilminfo();
            if(filminfo!=null) {
                tv_filmsub.setText(filminfo.getFIntroduce());
            }
            FilmEntity film = filmInfoBean.getFilm();
            if(film!=null) {
                tv_title.setText(film.getFYear()+":"+ film.getFName());
                if(GDManager.getInstance().getLikeById(film.getFId())) {
                    iv_save.setImageResource(R.drawable.like_2);
                }else {
                    iv_save.setImageResource(R.drawable.like_1);
                }
                iv_save.setTag(R.id.tag_first,film);
                iv_save.setOnClickListener(this);
                if(TextUtils.isEmpty(videoUrl)) {
                    tv_title.setGravity(Gravity.CENTER);
                }else {
                    if(!isbeginStyle) {
                        tv_title.setGravity(Gravity.CENTER);
                    }else {
                        tv_title.setGravity(Gravity.LEFT);
                    }
                }
//                GlideHelper.getInstance().loadGlideImage(context,iv_photoleft,film.getFPhoto());
                ImageLoader.getInstance().loadImage2Cache(context,iv_photoleft,film.getFPhoto());
//                ImageAsyncTask.getInstance().loadSmallImage(iv_photoleft,film.getFPhoto());
                imgurl = film.getFPhotow();
                videoName = film.getFYear()+":"+ film.getFName();
                if(!TextUtils.isEmpty(videoUrl)&&isbeginStyle) {
                    ll_video_ll.setVisibility(VISIBLE);


//                    List<Clarity> clarities = new ArrayList<>();
//                    clarities.add(new Clarity("标清", "270P", videoUrl));
//                    clarities.add(new Clarity("高清", "270P", videoUrl));
                    XxhVideoPlayerController controller = new XxhVideoPlayerController(context);
                    controller.setTitle(videoName);
                    controller.setLenght(0);
//                    controller.setClarity(clarities, 0);
                    ImageLoader.getInstance().loadImage2Cache(context,controller.imageView(),imgurl);
                    nice_video_player.setController(controller);
                    nice_video_player.setUp(videoUrl,null);
//                    item_videoplayer.setUp(videoUrl, JCVideoPlayer.SCREEN_LAYOUT_NORMAL,videoName, imgurl);
                }else {
                    ll_video_ll.setVisibility(GONE);
                }
                ImageLoader.getInstance().loadImageTrans2Cache(context,iv_head_bgview,film.getFPhotow());
                tv_release_country.setText(film.getFYear()+"年上映-"+film.getFCountryname());
                tv_type.setText(film.getFFilmtypename());

                String fImpression = film.getFImpression();
                if(TextUtils.isEmpty(fImpression)) {
                    fImpression = "真的很好看的一部电影,看了还想看,真的很不错.;很不错,真的很不错,值得一看;推荐大家看一看,很精彩;好久没看到过这么好看的电影了,超赞!";
                }
                if(TextUtils.isEmpty(fImpression)) {
                    view_labels_line.setVisibility(GONE);
                }else {
                    ArrayList<String> label = new ArrayList<>();
                    label.clear();
                    String[] split = fImpression.split(";");
                    for (int i =0;i<split.length;i++){
                        label.add(split[i]);
                    }
                    if(label.size()==2) {
                        label.add(label.get(0));
                        label.add(label.get(1));
                    }
                    if(label.size()==1) {
                        label.add("");
                        label.add(label.get(0));
                    }

                    if(label.size()>0) {
//                        AnimationUtils.getInstance().autoScrollAnimation((Activity) context,label,rl_autoview);
                        viewflipper.setVisibility(View.VISIBLE);
                        rl_autoview.setVisibility(View.VISIBLE);
                        ViewFlipperUtils.getInstance().setFlipperView(viewflipper,label, (Activity) context , 2);
                        ViewFlipperUtils.getInstance().startFlipper();
                        view_labels_line.setVisibility(VISIBLE);
                    }else {
                        viewflipper.setVisibility(GONE);
                        rl_autoview.setVisibility(GONE);
                        view_labels_line.setVisibility(GONE);
                    }
                }
            }
            FilmDetailInfo.ResultBean.VideoscoreBean videoscore = filmInfoBean.getVideoscore();
            if(videoscore!=null) {
                double v = videoscore.getFDouban() * 10;
                ratingBar.setProgress((int) v);
                tv_starsum.setText(v+"");
            }
            if(mScrollView!=null) {
                mScrollView.scrollToFirstView();
            }
        }
        if(guesslist!=null) {
            addHotFilmsView(guesslist);
            setAboutData(guesslist,mScrollView);
            if(mScrollView!=null) {
                mScrollView.scrollToFirstView();
            }
        }
        if(filmVideoBean!=null) {
            String videoVoucher = filmVideoBean.getVideoVoucher();


            if(!TextUtils.isEmpty(videoVoucher)) {
                videoUrl = videoVoucher;
                if(TextUtils.isEmpty(videoUrl)) {
                    tv_title.setGravity(Gravity.CENTER);
                }else {
                    if(!isbeginStyle) {
                        tv_title.setGravity(Gravity.CENTER);
                    }else {
                        tv_title.setGravity(Gravity.LEFT);
                    }
                }
                if(!TextUtils.isEmpty(videoUrl)&&isbeginStyle) {
                    ll_video_ll.setVisibility(VISIBLE);

//                    List<Clarity> clarities = new ArrayList<>();
//                    clarities.add(new Clarity("标清", "270P", videoUrl));
//                    clarities.add(new Clarity("高清", "270P", videoUrl));
                    XxhVideoPlayerController controller = new XxhVideoPlayerController(context);
                    controller.setTitle(videoName);
                    controller.setLenght(0);
//                    controller.setClarity(clarities, 0);
                    ImageLoader.getInstance().loadImage2Cache(context,controller.imageView(),imgurl);
                    nice_video_player.setController(controller);
                    nice_video_player.setUp(videoUrl,null);
//                    item_videoplayer.setUp(videoUrl, JCVideoPlayer.SCREEN_LAYOUT_NORMAL,videoName, imgurl);
                }else {
                    ll_video_ll.setVisibility(GONE);
                }
            }
            if(mScrollView!=null) {
                mScrollView.scrollToFirstView();
            }
        }
        if(filmSourceList!=null) {
            if(isbeginStyle&&filmSourceList.size()>0) {
                ll_openvideoview.setVisibility(VISIBLE);
                tv_sourcesum.setText(filmSourceList.size()+"个");
                ll_headbottom.setPadding(ViewSizeUtils.dp2px(context,15),ViewSizeUtils.dp2px(context,45),ViewSizeUtils.dp2px(context,15),0);
            }else {
                ll_openvideoview.setVisibility(GONE);
                ll_headbottom.setPadding(ViewSizeUtils.dp2px(context,15),ViewSizeUtils.dp2px(context,15),ViewSizeUtils.dp2px(context,15),0);
            }
            if(mScrollView!=null) {
                mScrollView.scrollToFirstView();
            }
        }


        if(mScrollView!=null) {
            mScrollView.scrollToFirstView();
        }
    }

    /**
     * 换个角度看电影
     * @param guesslist
     */
    private void setAboutData(final List<FilmEntity> guesslist,DetailScrollView mScrollView) {
        if(guesslist.size()>0) {
            //适配相关新闻部分
            FilmsAboutAdapter aboutAdapter = new FilmsAboutAdapter(guesslist, context);
            lv_aboutlist.setAdapter(aboutAdapter);
            lv_aboutlist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                    FilmEntity newsEntity = guesslist.get(position);
                    Intent intent = new Intent();
                    intent.setClass(context,FilmDetailActivity.class);
                    intent.putExtra(BaseActivity.PARAMETER1, newsEntity.getFId());
                    context.startActivity(intent);
                }
            });
            aboutAdapter.notifyDataSetChanged();
            lv_aboutlist.deferNotifyDataSetChanged();
            ll_aboutlist.setVisibility(VISIBLE);
            lv_aboutlist.setVisibility(VISIBLE);
            view_aboutlist.setVisibility(VISIBLE);
        }else {
            ll_aboutlist.setVisibility(GONE);
            lv_aboutlist.setVisibility(GONE);
            view_aboutlist.setVisibility(GONE);
        }
        mScrollView.scrollToFirstView();
    }

    private void addHotFilmsView(List<FilmEntity> guesslist) {
        if(guesslist!=null&&guesslist.size()>0) {
            ll_ll_imglistview.setVisibility(VISIBLE);
        }else {
            ll_ll_imglistview.setVisibility(GONE);
        }
        ll_imglistview.removeAllViews();
        for (int i =0;i<guesslist.size();i++){
            final FilmEntity filmEntity = guesslist.get(i);
            RelativeLayout relativeLayout = new RelativeLayout(context);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewSizeUtils.dp2px(context,103), ViewGroup.LayoutParams.MATCH_PARENT);
            relativeLayout.setLayoutParams(layoutParams);
            relativeLayout.setPadding(0,0,ViewSizeUtils.dp2px(context,9),0);
            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
            final ImageView imageView = new ImageView(context);
            imageView.setLayoutParams(params);
            imageView.setScaleType(ImageView.ScaleType.FIT_XY);
//            GlideHelper.getInstance().loadLowGlideImage(context,imageView,filmEntity.getFPhoto());
            ImageLoader.getInstance().loadImage2Cache(context,imageView,filmEntity.getFPhoto());
//            ImageAsyncTask.getInstance().loadBigImage(imageView,filmEntity.getFPhoto());
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent();
                    intent.setClass(context,FilmDetailActivity.class);
                    intent.putExtra(BaseActivity.PARAMETER1, filmEntity.getFId());
                    context.startActivity(intent);
                }
            });
            relativeLayout.addView(imageView);

            RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams(ViewSizeUtils.dp2px(context,20), ViewSizeUtils.dp2px(context,20));
            params1.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
            final ImageView imageView1 = new ImageView(context);

            imageView1.setLayoutParams(params1);
            imageView1.setPadding(ViewSizeUtils.dp2px(context,4),ViewSizeUtils.dp2px(context,4),ViewSizeUtils.dp2px(context,4),ViewSizeUtils.dp2px(context,4));
            imageView1.setScaleType(ImageView.ScaleType.FIT_XY);
            imageView1.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.collectno));
            imageView1.setBackground(ContextCompat.getDrawable(context,R.drawable.likelook_bg));
            imageView1.setTag(R.id.tag_first,false);
            for (int j = 0;j<likeData.size();j++){
                if(filmEntity.getFId().equals(likeData.get(j))) {
                    imageView1.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.collect));
                    imageView1.setTag(R.id.tag_first,true);
                }
            }
            imageView1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    boolean isSel = (boolean) v.getTag(R.id.tag_first);
                    if(isSel) {
                        imageView1.setImageDrawable( ContextCompat.getDrawable(context,R.drawable.collectno));
                        imageView1.setTag(R.id.tag_first,false);
                        likeData.remove(filmEntity.getFId());
                        GDManager.getInstance().delLikeLookData(filmEntity.getFId());
                    }else {
                        imageView1.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.collect));
                        imageView1.setTag(R.id.tag_first,true);
                        likeData.add(filmEntity.getFId());
                        GDManager.getInstance().insertLikeLookData(filmEntity);
                    }
                }
            });
            relativeLayout.addView(imageView1);


            ll_imglistview.addView(relativeLayout);
        }
    }

    boolean isFilmSub = false;
    @Override
    public void onClick(View v) {
        if (v == null || context == null) {
            return;
        }
        switch (v.getId()) {
            case R.id.ll_filmsub_more://展开简介
                if(tv_filmsub!=null) {
                    if(!isFilmSub) {
                        iv_opensub.setImageResource(R.drawable.up);
                        tv_filmsub.setMaxLines(100);
                        isFilmSub = true ;
                    }else {
                        iv_opensub.setImageResource(R.drawable.down);
                        tv_filmsub.setMaxLines(2);
                        isFilmSub = false ;
                    }
                }
                break;
            case R.id.iv_save:
                FilmEntity filmEntity = (FilmEntity) v.getTag(R.id.tag_first);
                if(filmEntity==null||TextUtils.isEmpty(filmEntity.getFId())||TextUtils.isEmpty(filmEntity.getFName())||TextUtils.isEmpty(filmEntity.getFPhoto())) {
                    ToastUtils.makeText("收藏操作失败");
                    return;
                }
                if(GDManager.getInstance().getLikeById(filmEntity.getFId())) {
                    GDManager.getInstance().delLikeLookData(filmEntity.getFId());
                    iv_save.setImageResource(R.drawable.like_1);
                    ToastUtils.makeText("删除收藏成功");
                }else {
                    GDManager.getInstance().insertLikeLookData(filmEntity);
                    iv_save.setImageResource(R.drawable.like_2);
                    ToastUtils.makeText("添加收藏成功");
                }
                break;
            case R.id.ll_openvideoview:
                if(nice_video_player!=null) {
                    nice_video_player.start();
                    nice_video_player.enterFullScreen();
                }
                break;
        }
    }
    
    public void setScrollCallback(ScrollCallback scrollCallback) {
        this.scrollCallback = scrollCallback;
    }

    @Override
    public void onEvent(int type, String url, int screen, Object... objects) {

    }


    /**
     * 滑动接口
     */
    public interface ScrollCallback {
        public void scroll(int l, int t, int oldl, int oldt);
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        if (scrollCallback != null) {
            scrollCallback.scroll(l, t, oldl, oldt);
        }

    }

    public void showAboutNews(){
        
    }

    /**
     * 设置相关电影
     *
     */
    public void setAboutData(final List<FilmEntity> newsEntityList, final OnClickListener shareClick) {
        setShareOnclick(shareClick);
    }

    /**
     * 初始化分享以及本地点赞记录
     */
    public void setShareOnclick(OnClickListener onClickListener) {
    }

    /**
     * 改变分享图片的大小
     * @param drawable
     */
    private void changeShareView(Drawable drawable) {
        if (drawable == null) {
            return;
        }
        drawable.setBounds(ViewSizeUtils.dp2px(context, 5), ViewSizeUtils.dp2px(context, 5),
                ViewSizeUtils.dp2px(context, 55), ViewSizeUtils.dp2px(context, 55));
    }




    /**
     * 内容滑动到最底端
     *
     * @return
     */
    public void scrollBottom() {
        fullScroll(ScrollView.FOCUS_DOWN);//滚动到底部
    }

    


    /**
     * 关注操作
     *
     * @param toUid
     * @param state
     */
    public void attention(String toUid, String state) {
//        if (TextUtils.isEmpty(toUid)) {
//            return;
//        }
//        if (!UserInforManager.getInstance().isLogin()) {
//            UserInforManager.getInstance().toLoginPage((Activity) context);
//            return;
//        }
//        Map<String, String> params = new HashMap<>();
//        params.put("uid", UserInforManager.getInstance().getUserInfor().getUid());
//        params.put("toUid", toUid);
//        String currentRequestType;
//        if (TextUtils.equals(state, "0")) {     //未关注->点击去关注
//            currentRequestType = "1";
//        } else {
//            //取消关注
//            currentRequestType = "2";
//        }
//        params.put("type", currentRequestType);
//
//        HttpListener<DataBean<AttentionStautsBean>> attentionListener = new HttpListener<DataBean<AttentionStautsBean>>() {
//            @Override
//            public void onStart() {
//                if (attentionImg != null) {
//                    attentionImg.setVisibility(View.GONE);
//                }
//                if (attentionPro != null) {
//                    attentionPro.setVisibility(View.VISIBLE);
//                }
//            }
//
//            @Override
//            public void onError(VolleyError error) {
//                if (attentionPro != null) {
//                    attentionPro.setVisibility(View.GONE);
//                }
//                if (attentionImg != null) {
//                    attentionImg.setVisibility(View.VISIBLE);
//                }
//                ToastUtils.makeText(getResources().getString(R.string.neterror_click));
//            }
//
//            @Override
//            public void onSuccess(DataBean<AttentionStautsBean> response) {
//                if (attentionPro != null) {
//                    attentionPro.setVisibility(View.GONE);
//                }
//                if (attentionImg != null) {
//                    attentionImg.setVisibility(View.VISIBLE);
//                }
//                if (response.noError() && response.getData() != null) {
//                    AttentionStautsBean attentionStautsBean = response.getData();
//                    changeAttentionState(attentionStautsBean.getStatus());
//                } else {
//                    ToastUtils.makeText("关注失败");
//                }
//            }
//        };
//
//        HttpUtils.addPostRequest(URIContant.ATTENTION_OR_NO, new TypeToken<DataBean<AttentionStautsBean>>() {
//        }.getType(), httpName, params, attentionListener);
    }

    /**
     * 改变关注状态
     *
     * @param state
     */
    public void changeAttentionState(String state) {
//        this.attentionBtn.setTag(state);
//        if (TextUtils.equals(state, TypeConstant.ATTENTION_NO)) {
//            this.attentionBtn.setSelected(true);
//            this.attentionText.setText("关注");
//            this.attentionText.setSelected(false);
//            this.attentionImg.getBackground().setLevel(3);
//        } else if (TextUtils.equals(state, TypeConstant.ATTENTION_YES)) {
//            this.attentionBtn.setSelected(false);
//            this.attentionText.setText("已关注");
//            this.attentionText.setSelected(true);
//            this.attentionImg.getBackground().setLevel(5);
//        } else if (TextUtils.equals(state, TypeConstant.ATTENTION_ALL)) {
//            this.attentionBtn.setSelected(false);
//            this.attentionText.setText("互相关注");
//            this.attentionText.setSelected(true);
//            this.attentionImg.getBackground().setLevel(1);
//        }
    }



}
